﻿using UnityEngine;
using System.Collections;

public class FollowPuffer : MonoBehaviour {
	public GameObject puffer;
	public float offsetx;
	public float offsety;

	Vector3 refpos;
	// Use this for initialization
	void Start () {
		refpos = transform.position;
	}
	
	// Update is called once per frame
	void Update () {
	//	DontDestroyOnLoad(transform.gameObject);
		refpos.y = puffer.transform.position.y - offsety;
		refpos.x = puffer.transform.position.x -offsetx;
		transform.position = refpos;
		
		//		Quaternion rotation = Quaternion.Euler(xAngle, yAngle, zAngle);
		//Vector3 direction = rotation * Vector3.forward;




	}
}
//////////


/*'

Since force is a vector, you need to convert your angle into a Quaternion to represent rotation, then use that to rotate a forward Vector3 so it points toward the angle.

The rotation transform happens by using the Quaternion * Operator.

The direction vector should now point toward angle. I haven't tested this, so it may require some tweaking, but this is the basic idea for converting an angle to a vector. Your best bet is to do this math only as the wind direction changes, and then use the vector for everything related to it.

*/